package benchmark.energy.tx;

import benchmark.transaction.definition.AbstractTransaction;
import benchmark.utils.Helper;
import benchmark.utils.Triple;

import java.util.*;

public class SnapshotAggrDurationTx extends AbstractTransaction {
    private int t0;
    private int t1;
    private String p;
    private TreeSet<Integer> intervalStarts;

    public SnapshotAggrDurationTx() {
        this.setTxType(TxType.TX_QUERY_SNAPSHOT_AGGR_DURATION);
    }

    public int getT0() {
        return t0;
    }

    public int getT1() {
        return t1;
    }

    public String getP() {
        return p;
    }

    public void setT0(int t0) {
        this.t0 = t0;
    }

    public void setT1(int t1) {
        this.t1 = t1;
    }

    public void setP(String p) {
        this.p = p;
    }

    public TreeSet<Integer> getIntervalStarts() {
        return intervalStarts;
    }

    public void setIntervalStarts(TreeSet<Integer> intervalStarts) {
        this.intervalStarts = intervalStarts;
    }

    public static class Result extends AbstractTransaction.Result {
        List<Triple<String, Integer, Integer>> statusDuration;

        public List<Triple<String, Integer, Integer>> getStatusDuration() {
            return statusDuration;
        }

        public void setStatusDuration(List<Triple<String, Integer, Integer>> statusDuration) {
            this.statusDuration = statusDuration;
        }
    }

    @Override
    public void validateResult(AbstractTransaction.Result result) {
        Helper.validateResult(((Result) this.getResult()).getStatusDuration(), ((Result) result).getStatusDuration());
    }
}
